
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 2
 * @Author : WangRuoyu 
 * @Date : 2023/5/19 9:35
 */

#include "iostream"

using namespace std;

const int N = 100010;
int c[N];
int n, m, k, tmax = 0;

int main() {
    scanf("%d %d %d", &n, &m, &k);
    for (int i = 0; i < n; ++i) {
        int a, b;
        scanf("%d %d", &a, &b);
        c[a] += b;
        tmax = max(tmax, a);
    }

    int res = tmax;
    for (int i = tmax; i > k; --i) {
        if (m < c[i]) break;
        m -= c[i];
        c[i - 1] += c[i];
        res--;
    }

    printf("%d", res);

    return 0;
}